package com.sgb.kjwl.view.ui.adapter.search;

import android.content.Context;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.SearchMachineOutEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class SearchMachineOutAdapter extends BaseRecycleAdapter<SearchMachineOutEntity> {

    private TextView contentView;
    private TextView priceView;

    public SearchMachineOutAdapter(Context context, List<SearchMachineOutEntity> datas) {
        super(context, R.layout.item_search_machine_out, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final SearchMachineOutEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        contentView = holder.getItem().findViewById(R.id.content_view);
        priceView = holder.getItem().findViewById(R.id.price_view);
        contentView.setText(entity.getAreaName() + "|" + entity.getBrandName());
        priceView.setText(entity.getPrice() + entity.getUnit());
    }

}
